package com.hand.demo.app.service.Validator;

/*import com.fasterxml.jackson.databind.ObjectMapper;
import com.hand.demo.domain.entity.Example;
import com.hand.demo.domain.repository.ExampleRepository;
import org.hzero.boot.imported.app.service.IDoImportService;
import org.hzero.boot.imported.infra.validator.annotation.ImportService;
import org.springframework.beans.factory.annotation.Autowired;

import java.io.IOException;
//导入
@ImportService(templateCode = "EXAMPLE_CLIENT")*/
public class DemoTestClient /*implements IDoImportService*/ {
   /* @Autowired
    private ObjectMapper objectMapper;
    @Autowired
    private ExampleRepository repository;
    @Override
    public Boolean doImport(String data) {
        Example example;
        try {
            example = objectMapper.readValue(data, Example.class);
        } catch (IOException e) {
            // 失败
            return false;
        }
        //id、code、name不为空
        if(example.getId()!=null && example.getCode()!=null && example.getName()!=null){
            repository.insertSelective(example);
        }
        // 成功
        return true;
    }*/
}
